import java.util.Arrays;
import java.util.Scanner;

public class Text1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] arr = new int[6];
        for(int i = 0; i < 6; i++){
            arr[i] = in.nextInt();
        }
        System.out.println(Arrays.toString(arr));
        int left = 0;
        int right = 5;
        int temp = 0;
        while(left < right){
            temp = arr[left];
            arr[left] = arr[right];
            arr[right] = temp;
            left++;
            right--;
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main4(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        boolean flag = false;
        int i = 0;
        for( i = 2; i < Math.sqrt(num); i++){
            if(num % i == 0){
                System.out.print(flag);
                break;
            }
        }
        if(i >= Math.sqrt(num)){
            flag = true;
            System.out.print(flag);
        }
    }
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        int pay = in.nextInt();
        int shouldPay = 0;
        if(pay >= 5000){
            shouldPay = (int)(0.6 * pay);
        }else if (5000 >= pay && pay>= 2000){
            shouldPay = (int)(0.7 * pay);
        }else if (2000 >= pay && pay >= 500){
            shouldPay = (int)(0.8 * pay);
        }else if (500 >= pay && pay >= 100){
            shouldPay = (int)(0.9 * pay);
        }

        System.out.print(shouldPay);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();

        int temp = 0;
        if(a < b){
            temp = a;
            a = b;
            b = temp;
        }

        System.out.println(a+b+" "+(a-b)+" "+a*b+" "+a/b+" "+a%b);
    }

    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = "what";

        while (!(str = sc.nextLine()).isEmpty()) {
            char[] str1 = new char[52];
            str1[0] = str.charAt(0);
            int j = 1;
            for (int i = 1; i < str.length(); i++) {
                if (str.charAt(i) != str.charAt(0)) {
                    str1[j] = str.charAt(i);
                    j++;
                    str = str.replace(str.charAt(i), str.charAt(0));
                }
            }
            for (int k = 0; k < j; k++) {
                System.out.print(str1[k]);
            }
        }
    }
}
